package com.power.ding.model;


import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.plf.core.base.model.Ha_depart;
import com.plf.core.base.model.Ha_user;
import com.plf.core.common.domain.BaseModel;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
*  用户信息实体类
*/

@Entity
@ApiModel(value="用户信息")
@Data
@Table(name="Di_user")
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = false)
//@IdClass(Di_user.Di_userPK.class) 用于复合组件
public class Di_user extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @ApiModelProperty(value = "外部编号")
    private String foreignId;

    /**
     * -1已删除；>=0正常
     */
    @ApiModelProperty(value = "删除标识")
    private Integer rowState;

//    /**
//     * 格式: 2020-01-07 03:03:05
//     */
//    @ApiModelProperty(value = "最后修改时间", example="2020-10-22 10:03:22")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    private Date lastUpdateTime;

    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @ApiModelProperty(value = "登录名")
    private String logName;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "工号")
    private String cardId;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "联系电话")
    private String tel;

    @Column(nullable = false)
    @ApiModelProperty(value = "手机")
    private String mobile;

    @ApiModelProperty(value = "电子邮件")
    private String email;

    @ApiModelProperty(value = "家庭住址")
    private String homeAdd;

    @ApiModelProperty(value = "家庭电话")
    private String homeTel;

    @ApiModelProperty(value = "家庭邮编")
    private String homeZipcode;

    @ApiModelProperty(value = "家庭邮编")
    private String fax;

    @ApiModelProperty(value = "拼音全拼")
    private String pinyin;

    @ApiModelProperty(value = "拼音首字母")
    private String pinyinInitial;

    @ApiModelProperty(value = "职级编码")
    private String careerRank;

    @ApiModelProperty(value = "职级")
    private String careerRankText;

    @ApiModelProperty(value = "职务")
    private String unitRank;

    /**
     * 1男；2女
     */
    @ApiModelProperty(value = "性别编码")
    private Integer sex;

    @ApiModelProperty(value = "性别")
    private String sexText;

    @ApiModelProperty(value = "教育程度编码")
    private Integer education;

    @ApiModelProperty(value = "教育程度")
    private String educationText;

    /**
     * 1有效；-1封锁；-2离退休；-3调离
     */
    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "状态")
    private String statusText;

//    @ApiModelProperty(value = "出生日期", example="2020-10-22 10:03:22")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    private Date birthday;

    @ApiModelProperty(value = "年龄")
    private Integer age;

//    @ApiModelProperty(value = "参加工作时间", example="2020-10-22 10:03:22")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    private Date joinWork;

//    @ApiModelProperty(value = "进入本单位时间", example="2020-10-22 10:03:22")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    private Date joinCompany;

    @ApiModelProperty(value = "显示顺序")
    private Integer showOrder;

    @ApiModelProperty(value = "密级等级")
    private Integer mjLevel;

    @ApiModelProperty(value = "密级等级")
    private String mjLevelText;

    @ApiModelProperty(value = "直接领导")
    private String leaderText;

    @ApiModelProperty(value = "直接领导ID")
    private String leader;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "头像")
    private String photo;

    @ApiModelProperty(value = "身份证号")
    private String idNumber;

    @ApiModelProperty(value = "聊天工具ID")
    private String imId;

    @ApiModelProperty(value = "办公地点")
    private String workPlace;

    @ApiModelProperty(value = "CA证书序列号")
    private String certSN;

    @ApiModelProperty(value = "签名图片")
    private String signPhoto;

    @ApiModelProperty(value = "签名图片")
    private String cabinetCode;

    /**
     * -1否，1是
     */
    @ApiModelProperty(value = "是否在编用户")
    private Integer isFormation;

    @ApiModelProperty(value = "是否在编用户")
    private String isFormationText;

    @ApiModelProperty(value = "职称编码")
    private Integer professionalRank;

    @ApiModelProperty(value = "职称")
    private String professionalRankText;

    @ApiModelProperty(value = "人员编制编号")
    private String formation;

    @ApiModelProperty(value = "人员编制名称")
    private String formationText;

    @ApiModelProperty(value = "机构ID")
    private String unitId;

    /**
     * 所属区划
     */
    @Transient
    private String adid;

    /**
     * 所属区划父级id
     */
    @Transient
    private String fid;

    /**
     * 所属部门列表
     */
    @Transient
    private List<Di_dept> deptList;

    /**
     * 审批端人员信息
     */
    @Transient
    private Ha_user approveUser;

    /**
     * 审批端部门信息
     */
    @Transient
    private List<Ha_depart> approveDepar;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("foreignId", this.getForeignId());
        map.put("rowState", this.getRowState());
//        map.put("lastUpdateTime", this.getLastUpdateTime());
        map.put("userName", this.getUserName());
        map.put("logName", this.getLogName());
        map.put("password", this.getPassword());
        map.put("cardId", this.getCardId());
        map.put("nickName", this.getNickName());
        map.put("tel", this.getTel());
        map.put("mobile", this.getMobile());
        map.put("email", this.getEmail());
        map.put("homeAdd", this.getHomeAdd());
        map.put("homeTel", this.getHomeTel());
        map.put("homeZipcode", this.getHomeZipcode());
        map.put("fax", this.getFax());
        map.put("pinyin", this.getPinyin());
        map.put("pinyinInitial", this.getPinyinInitial());
        map.put("careerRank", this.getCareerRank());
        map.put("careerRankText", this.getCareerRankText());
        map.put("unitRank", this.getUnitRank());
        map.put("sex", this.getSex());
        map.put("sexText", this.getSexText());
        map.put("education", this.getEducation());
        map.put("educationText", this.getEducationText());
        map.put("status", this.getStatus());
        map.put("statusText", this.getStatusText());
//        map.put("birthday", this.getBirthday());
        map.put("age", this.getAge());
//        map.put("joinWork", this.getJoinWork());
//        map.put("joinCompany", this.getJoinCompany());
        map.put("showOrder", this.getShowOrder());
        map.put("mjLevel", this.getMjLevel());
        map.put("mjLevelText", this.getMjLevelText());
        map.put("leaderText", this.getLeaderText());
        map.put("leader", this.getLeader());
        map.put("remark", this.getRemark());
        map.put("photo", this.getPhoto());
        map.put("idNumber", this.getIdNumber());
        map.put("imId", this.getImId());
        map.put("workPlace", this.getWorkPlace());
        map.put("certSN", this.getCertSN());
        map.put("signPhoto", this.getSignPhoto());
        map.put("cabinetCode", this.getCabinetCode());
        map.put("isFormation", this.getIsFormation());
        map.put("isFormationText", this.getIsFormationText());
        map.put("professionalRank", this.getProfessionalRank());
        map.put("professionalRankText", this.getProfessionalRankText());
        map.put("formation", this.getFormation());
        map.put("formationText", this.getFormationText());
        map.put("unitId", this.getUnitId());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Di_userPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Di_userPK pk = (Di_userPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
